package net.wofly.sale.commission.service.impl;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;

import net.wofly.sale.commission.repository.OrderCommissionRepository;
import net.wofly.sale.commission.domain.OrderCommission;
import net.wofly.sale.commission.service.IOrderCommissionService;

@Service("iOrderCommissionService")
@Transactional
public class OrderCommissionServiceImpl implements IOrderCommissionService {

	@Autowired
	OrderCommissionRepository orderCommissionRepository;

	@Override
	public OrderCommission save(OrderCommission entity) {
		return orderCommissionRepository.save(entity);
	}

	@Override
	public void delete(OrderCommission entity) {
		orderCommissionRepository.delete(entity);
	}

	@Override
	public void delete(String key) {
		orderCommissionRepository.delete(key);
	}

	@Override
	public OrderCommission findOne(String key) {
		return orderCommissionRepository.findOne(key);
	}

	@Override
	public List<OrderCommission> save(List<OrderCommission> entityList) {
		return (List<OrderCommission>) orderCommissionRepository.save(entityList);
	}

	@Override
	public Page<OrderCommission> findAll(Specification specification, Pageable pageable) {
		return orderCommissionRepository.findAll(specification, pageable);
	}

	@Override
	public Page<OrderCommission> findAll(Pageable pageable) {
		return orderCommissionRepository.findAll(pageable);
	}
}
